#include <bits/stdc++.h>
// 2025/03/17
// tag: 
// Author: Forever
using namespace std;

using int64 = int64_t;
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int w;
    cin >> w;
    for (int i = 1; i <= w; i++){
        string s;
        cin >> s;
        s[s.size() - 1] = '\n', s[s.size() - 2] = 'i';
        cout << s;
    }
    return 0;
}